<?php
//defines html layout: works by calling head() and foot() at the beginning and end of each html 
//defines html form element that contains the inputs posted on submit
//the foot() function can take a variable number argument list: each pair is treated as a button label and a target
//		and it will display the buttons in the button panel 

session_start();
	

function head($title) { ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/standard.dtd">
<?php

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past      

    header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );
    header( "Cache-Control: no-cache, must-revalidate" );
    header( "Pragma: no-cache" );
?>

<html lang="en">
 <head>
  <title><?php echo $title?></title>
  <link rel="stylesheet" href="css/styles.css" type="text/css"/>

<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-control" CONTENT="no-cache">
<META HTTP-EQUIV="Cache" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="thu, 01 Jan 1998 12:00:00 GMT"> 

  <script type="text/javascript" src="javascript/common.js"></script>
    <?php includeValidateJS(); 
    /*inlines page specific javascript  */ ?>
 
 </head>
 <body onload="javascript:showErrorMessageDiv();setPromptHandlers();">

	<div id="container"> 
	<div id="header">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $title?></div>

	<div id="wrapper">
	<input type="hidden" id="errMessage" 
		value="<?php if (isset($_REQUEST['errorMessage'])) echo $_REQUEST['errorMessage'];?>" />
	
	<div id="errorMessage" name="errorMessage">
		 
		&nbsp;
		 
	</div>
	<form id="mainform" name="mainform" method="post" 
		action="errorPage.php" >
			<div id="content">
				<input type="hidden" name="buttonPressed" id="buttonPressed" value="" />
<?php
}

function foot() { ?>
			<div>
				&nbsp;
			</div>
		</div>

		
	</form>
	
	</div>
	<div id="navigation">
		<div id="manageOrders">
			<div class="button1">
				<a href="javascript:showOrderMenus();">
					 Orders
				</a> 
			</div>
		</div>
		<div id="manageOrdersFoldout"  style="display:none">
			<div class="button1">
				<a href="javascript:hideOrderMenus();">
				 	 Orders
				</a> 
			</div>
			<div class="button2">
				<a href="manageOrders.php?operation=all">
					Manage Orders
				</a> 
			</div>				
			<div class="button2">
				<a href="manageTasks.php?operation=all">
					Manage Tasks
				</a> 
			</div>
				
			<div class="button2">
				<a href="reassignTask.php">
					Reassign Task
				</a> 
			</div>		
			<div class="button2">
				<a href="manageShippingOption.php?operation=add">
					Add Delivery Service
				</a> 
			</div>				
			<div class="button2">
				<a href="viewShippingOptions.php">
					Manage Delivery Services
				</a> 
			</div>				
		</div>				
		
	
						
		<div id="manageEmployees">
			<div class="button1">
				<a href="javascript:showEmployeeMenus();">
					 Staff
				</a> 
			</div>
		</div>
		<div id="manageEmployeesFoldout"  style="display:none">
			<div class="button1">
				<a href="javascript:hideEmployeeMenus();">
				 	 Staff
				</a> 
			</div>
			<div class="button2">
				<a href="manageEmployee.php?operation=add">
					Add Employee
				</a> 
			</div>
			<div class="button2">
				<a href="viewEmployees.php">
					Manage Employees
				</a> 
			</div>			
			<div class="button2">
				<a href="bankHolidays.php">
					Bank Holidays
				</a> 
			</div>	
					
		</div>	

		<div id="manageFabrics">
			<div class="button1">
				<a href="javascript:showFabricMenus();">
					 Fabrics
				</a> 
			</div>
		</div>
		<div id="manageFabricsFoldout"  style="display:none">
			<div class="button1">
				<a href="javascript:hideFabricMenus();">
				 	 Fabrics
				</a> 
			</div>
			<div class="button2">
				<a href="manageFabric.php?operation=add">
					Add Fabric
				</a> 
			</div>
			<div class="button2">
				<a href="viewFabrics.php">
					Manage Fabrics
				</a> 
			</div>				
		</div>	
		
		<div id="manageGarments">
			<div class="button1">
				<a href="javascript:showGarmentMenus();">
					 Garments
				</a> 
			</div>
		</div>
		<div id="manageGarmentsFoldout"  style="display:none">
			<div class="button1">
				<a href="javascript:hideGarmentMenus();">
				 	 Garments
				</a> 
			</div>
			<div class="button2">
				<a href="manageGarment.php?operation=add">
					Add Garment
				</a> 
			</div>
			<div class="button2">
				<a href="viewGarments.php">
					Manage Garments
				</a> 
			</div>				
		</div>		


		<div>
			&nbsp;
		</div>
	</div>
	
	<div id="buttonPanel" align=right>
		<table>
			<tr>
				<?php
				for ($i = 0;$i < func_num_args();$i += 2) {
					$buttonLabel = func_get_arg($i);
					 $submitTo = func_get_arg($i + 1);
					echo '<td>'; 
			      	makebutton($buttonLabel, $submitTo);
					echo '</td>'; 
			    }
				?>		
			</tr>
		</table>
	</div>
	
	<div id="prompt">
		&nbsp;
	</div>
	
	</div>
	</body>
<HEAD>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</HEAD> 	
	</html>
<?php
	}
?>
